package com.linwen.javase.desgin_pattern.BigTalkDesignPattenJAVACode._03装饰模式._6装饰器_策略工厂;

/**
 * @ClassName CashRebate
 * @Description TODO
 * @Author zero
 * @DATE 2023/7/10 11:19 PM
 * @Version 1.0
 */
public class CashRebate extends CashSuper implements ISale {

    private double moneyRebate = 1d;

    public CashRebate(double moneyRebate) {
        this.moneyRebate = moneyRebate;
    }

    @Override
    public double acceptCash(double price, int num) {
        double result =  price * num * moneyRebate;
        return super.acceptCash(result,1);
    }
}
